home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
626-637
/
disk_632
/
printfiles
/
source
/
prf.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
13KB
|
393 lines
/* prf.h V1.1 */
/* 9-3-92 */
#include <devices/printer.h>
/*
#define DEUTSCH
*/
/* to create an english executable remove the line above */
#ifdef DEUTSCH
#include "prf.deutsch.h"
#else
#include "prf.english.h"
#endif
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* Define's */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
#define SYSTEM_VERSION 37L
#define STR_SIZE 256
#define DEFAULT_LINES 66L
#define DEFAULT_LMARGIN 0L
#define DEFAULT_RMARGIN 128L
#define DEFAULT_QUALITY 0L
#define DEFAULT_PITCH 1L
#define DEFAULT_CPI 2L
#define DEFAULT_FLAGS (FLAG_DRAFT | FLAG_PITCH8 | FLAG_15CPI | FLAG_DISPLAY)
#define FILE_UNKNOWN 0L
#define FILE_TEXT 1L
#define FILE_ILBM 2L
#define FILE_FTXT 3L
#define FILE_PROG 4L
#define FILE_ICON 5L
#define FILE_DIR 6L
#define FLAG_DATE 1
#define FLAG_TIME (1 << 1)
#define FLAG_FILE (1 << 2)
#define FLAG_PAGE (1 << 3)
#define FLAG_LINE (1 << 4)
#define FLAG_CRLF (1 << 5)
#define FLAG_FF (1 << 6)
#define FLAG_PRINT (1 << 7)
#define FLAG_DRAFT (1 << 8)
#define FLAG_LQ (1 << 9)
#define FLAG_IMMEDIATE (1 << 10)
#define FLAG_OPENWINDOW (1 << 11)
#define FLAG_PITCH6 (1 << 12)
#define FLAG_PITCH8 (1 << 13)
#define FLAG_10CPI (1 << 14)
#define FLAG_12CPI (1 << 15)
#define FLAG_15CPI (1 << 16)
#define FLAG_DISPLAY (1 << 17)
#define TOOLTYPE_WD "WINDOW"
#define TOOLTYPE_FLAGS "FLAGS"
#define TOOLTYPE_HEAD "HEADLINE"
#define TOOLTYPE_FOOT "FOOTLINE"
#define TOOLTYPE_LINES "LINES"
#define TOOLTYPE_RMARGIN "RMARGIN"
#define TOOLTYPE_LMARGIN "LMARGIN"
#define CLI_WD 'w'
#define CLI_DRAFT 'a'
#define CLI_LQ 'q'
#define CLI_PAGE 'p'
#define CLI_DATE 'd'
#define CLI_LINE 'l'
#define CLI_FF 'f'
#define CLI_CRLF 'c'
#define CLI_10CPI '0'
#define CLI_12CPI '2'
#define CLI_15CPI '5'
#define CLI_PITCH6 '6'
#define CLI_PITCH8 '8'
#define CLI_FILE 'n'
#define CLI_TIME 't'
#define CMD_NEUTRAL 0L
#define CMD_PRINT 1L
#define CMD_CHANGEAPP 2L
#define CMD_QUIT 3L
#define CMD_INSERTHEAD 4L
#define CMD_INSERTTAIL 5L
#define CMD_REMOVE 6L
#define CMD_FILEREQ 7L
#define CMD_DISPLAY 8L
#define CMD_STR_INSERT 9L
#define CMD_OPENPWD 10L
#define CMD_CLOSEPWD 11L
#define CMD_ABOUT 12L
#define CMD_HEAD 13L
#define CMD_FOOT 14L
#define CMD_DATE_ON 15L
#define CMD_TIME_ON 16L
#define CMD_NAME_ON 17L
#define CMD_FF_ON 18L
#define CMD_CRLF_ON 19L
#define CMD_PAGE_ON 20L
#define CMD_LINE_ON 21L
#define CMD_PITCH6 22L
#define CMD_PITCH8 23L
#define CMD_HEADL 24L
#define CMD_FOOTL 25L
#define CMD_RESETALL 26L
#define CMD_CLEARLIST 27L
#define CMD_OPENWD 28L
#define CMD_CLOSEWD 29L
#define CMD_RXQUIT 30L
#define CMD_10CPI 31L
#define CMD_12CPI 32L
#define CMD_15CPI 33L
#define CMD_LINES 34L
#define CMD_DRAFT 35L
#define CMD_LQ 36L
#define CMD_LMARGIN 37L
#define CMD_RMARGIN 38L
#define CMD_DATE_OFF 39L
#define CMD_TIME_OFF 40L
#define CMD_NAME_OFF 41L
#define CMD_FF_OFF 42L
#define CMD_CRLF_OFF 43L
#define CMD_PAGE_OFF 44L
#define CMD_LINE_OFF 45L
#define CMD_SAVEPREFS 46L
#define CMD_STATUS 47L
#define CMD_VERSION 48L
/* rexx commands */
#define RXPORTNAME "PRINTFILES"
#define RX_ERRORLEVEL 5L
#define RX_VERSION_STR T_PRF T_VERSION
#define T_RX_RESET "reset"
#define T_RX_CLEAR "clear"
#define T_RX_INSFILE "insfile"
#define T_RX_REMFILE "remfile"
#define T_RX_OPENWINDOW "openwindow"
#define T_RX_CLOSEWINDOW "closewindow"
#define T_RX_QUIT "quit"
#define T_RX_PAGE "page"
#define T_RX_FILE "filename"
#define T_RX_TIME "time"
#define T_RX_DATE "date"
#define T_RX_LINE "line"
#define T_RX_FF "ff"
#define T_RX_CRLF "crlf"
#define T_RX_HEAD "headline"
#define T_RX_FOOT "footline"
#define T_RX_LINES "lines"
#define T_RX_RMARGIN "rmargin"
#define T_RX_LMARGIN "lmargin"
#define T_RX_DRAFT "draft"
#define T_RX_LQ "lq"
#define T_RX_PITCH6 "6li"
#define T_RX_PITCH8 "8li"
#define T_RX_10CPI "10cpi"
#define T_RX_12CPI "12cpi"
#define T_RX_15CPI "15cpi"
#define T_RX_ON "on"
#define T_RX_OFF "off"
#define T_RX_CONTROL "control"
#define T_RX_PREFS "prefs"
#define T_RX_PRINT "print"
#define T_RX_SAVEPREFS "saveprefs"
#define T_RX_STATUS "status"
#define T_RX_VERSION "version"
#define T_RX_ERROR "Unknown command"
#define T_RX_PMSG "printing"
#define T_RX_WMSG "waiting"
#define RX_CMD_NEUTRAL 0
#define RX_CMD_ON 1
#define GD_PwdButton 0
#define GD_About 1
#define GD_Headline 2
#define GD_Footline 3
#define GD_Date 4
#define GD_Time 5
#define GD_Filename 6
#define GD_Pagenumber 7
#define GD_Linenumber 8
#define GD_CRLF 9
#define GD_FF 10
#define GD_Gadget11 11
#define GD_List 12
#define GD_Filereq 13
#define GD_Remove 14
#define GD_Print 15
#define GD_quit 16
#define GD_Quality 17
#define GD_Pitch 18
#define GD_Linesperpage 19
#define GD_cpi 20
#define GD_Lmargin 21
#define GD_Rmargin 22
#define GD_Saveprefs 23
#define GD_PPrint 24
#define PGD GD_Quality
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* Data structure definition */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
union printerIO
{
struct IOStdReq ios;
struct IODRPReq iodrp;
struct IOPrtCmdReq iopc;
};
struct FileNameNode
{
struct Node fnn_Node;
char fnn_Name[STR_SIZE];
};
struct prf_info
{
struct Screen *PubScr;
APTR VisualInfo;
struct Window *Swd;
struct Window *Pwd;
struct IntuiMessage *imsg;
struct AppMessage *amsg;
struct RexxMsg *rmsg;
union PrinterIO *pio;
struct MsgPort *rexxPort;
struct MsgPort *appPort;
struct MsgPort *prtPort;
struct AppWindow *aWnd;
struct AppIcon *aicon;
struct AppMenuItem *amenu;
struct Gadget *SGlist;
struct Gadget *PGlist;
struct Gadget *SGadgets[17];
struct Gadget *PGadgets[20];
struct List FileList;
ULONG Lines;
ULONG Lmargin;
ULONG Rmargin;
ULONG Columns;
ULONG signals;
ULONG flags;
ULONG BarHeight;
UBYTE Headline[STR_SIZE];
UBYTE Footline[STR_SIZE];
UBYTE Statusline[STR_SIZE];
UBYTE Insertline[STR_SIZE];
APTR Special1;
APTR Special2;
APTR Special3;
APTR Special4;
};
union wbstart
{
char **args;
struct WBStartup *msg;
};
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_main.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
void main(int,union wbstart);
long OpenLibs(struct prf_info *);
void CloseLibs(struct prf_info *);
void Prf_Reset(struct prf_info *);
void SetPrfSignals(struct prf_info *);
long HandleMsgs(struct prf_info *);
void SavePreferences(struct prf_info *,UBYTE *);
/* vars */
extern long _stack;
extern char *_procname;
extern long priority;
extern long _BackGroundIO;
extern BPTR _Backstdout;
extern struct GfxBase *GfxBase;
extern struct IntuitionBase *IntuitionBase;
extern struct Library *WorkBenchBase;
extern struct Library *GadToolsBase;
extern struct Library *AslBase;
extern struct Library *IconBase;
extern struct RxsLib *RexxSysBase;
extern struct TextAttr topaz8;
extern char *dayname[];
extern char *monthname[];
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_apphandler.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
long OpenApp(struct prf_info *);
void CloseApp(struct prf_info *);
long HandleAmsg(struct prf_info *);
void ChangeApp(struct prf_info *);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_imsghandler.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
long HandleImsg(struct prf_info *);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_swd.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
long OpenSwd(struct prf_info *);
void CloseSwd(struct prf_info *);
long OpenPwd(struct prf_info *);
void ClosePwd(struct prf_info *);
void RefreshSwd(struct prf_info *);
void RefreshPwd(struct prf_info *);
/* vars */
extern struct TagItem SwdTags[];
extern struct TagItem PwdTags[];
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_list.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
void InsertName(struct prf_info *);
void RemoveName(struct prf_info *);
void AttachList(struct prf_info *);
void DetachList(struct prf_info *);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_docommand.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
long DoCommand(struct prf_info *,long);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_filereq.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
void Prf_FileReq(struct prf_info *);
void Prf_SavePrefs(struct prf_info *,UBYTE *);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf.rexx.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
long HandleRexxMsg(struct prf_info *);
void AttemptOpenRexx(struct prf_info *);
void CloseRexx(struct prf_info *);
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* prf_print.c */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* protos */
void PrintQueue(struct prf_info *);
/* vars */
extern char *dayname[];
extern char *monthname[];
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */